package com.jiuqi.site.Controller;

import com.jiuqi.site.entity.User;
import com.jiuqi.site.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

@RestController
@RequestMapping("user")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/insertUser")
    public String insertUser(){
        User user = new User();
        user.setId("1");
        user.setName("jack");
        user.setPassword("123456");
        user.setAvatar("121212");
        user.setEmail("123@qq.com");
        user.setPhone("13658498765");
        user.setSex(0);
        user.setCreate_time(new Date());
        userService.insertUser(user);
        return "successful";
    }
}
